﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Loong.Model
{
   /// <summary>
    /// 网址模型
   /// </summary>
    [Serializable]
    public class  UrlModelInfo
    {
        /**
         * 网址规则类型
         * 0=单个网址
         * 1=批量网址
         * 2=文件读取
         * 4=正规生成
         */
        private uint tyle=1;


        private string name;

        /// <summary>
        /// 构造网址规则模型
        /// </summary>
        /// <param name="tyle">类型:0=单个网址,1=批量网址,2=文件读取,4=正规生成</param>
        /// <param name="name">名称</param>
        public UrlModelInfo(uint tyle, string name)
        {
            this.tyle = tyle;
            this.name = name; 
        }

        public uint Type
        {
            get { return this.tyle; }
            set {           
                if ((value < 0) || (value > 4))
                {
                    throw new OverflowException("输入不能小于0,或者大于4;");
                }

                this.tyle = value;
            }
        }

        public string Name
        {
            get { return this.name; }
            set {
                this.name = value;
            }
        }
    }
}
